<template>
	<view class="myCard">
		<view class="listItem y-c">
			<view class="item_top y-c border">
				<view class="item_top_row x-bc mb-2">
					<view>{{details.name}}</view>
					<view>¥{{details.price}}/次</view>
				</view>
			</view>
			<view class="item_bot y-c">
				<view class="item_top_row x-bc mb-2 mt-2">
					<view class="next"> 交易状态</view>
					<view>
						<image src="../../static/icon/my/cancelled.png" mode="" class="image" v-if="details.status==2"></image>
						<image src="../../static/icon/my/dhx.png" mode="" class="image" v-if="details.status==3"></image>
						<image src="../../static/icon/my/payed.png" mode="" class="image" v-if="details.status==1"></image>
						<text  v-if="details.status==0">待付款</text>
					</view>
				</view>
				<view class="item_top_row x-bc mb-2 mt-2">
					<view class="next">支付金额</view>
					<view>
						{{details.price}}
					</view>
				</view>
				<view class="item_top_row x-bc mb-2 mt-2">
					<view class="next">订单编号</view>
					<view>
						{{details.order_no}}
					</view>
				</view>
				<view class="item_top_row x-bc mb-2 mt-2">
					<view class="next">下单时间</view>
					<view>
						{{details.createtime}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		orderSee
	} from '@/request/api.js'
	export default {
		data() {
			return {
			 details:{
				 createtime: '',
				 name: " ",
				 order_no: "",
				 price: "",
				 status: "",
				 status_text: "",
				 type_data: "",
			 }
			}
		},
		onLoad(res) {
			console.log(res,55)
			this.getDetails(res.id)
		},
		methods: {
			async getDetails(id) {
			let res=await orderSee({id})
			this.details = res.data
			console.log(this.details,'details')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.myCard {
		padding: 40rpx;

		.listItem {
			color: $common-color;
			background: #fff;
			border-radius: 20rpx;
			padding: 20rpx;
			box-sizing: border-box;
			margin-top: 20rpx;

			.item_over {
				text-overflow: ellipsis;
				white-space: nowrap;
				overflow: hidden;
			}
		}

		.border {
			border-bottom: 0.5rpx solid rgba(217, 217, 217, 0.6);
		}

		.item_bot {
			color: #BABABA;

			.next {
				color: #BABABA;
			}

			.image {
				width: 116rpx;
				height: 100rpx;
			}
		}

	}
</style>